Telegram Group & Telegram Channel
#سوال

اینو حتماً شنیدید:
توی پایتون GIL باعث می‌شه multi-thread واقعی نداشته باشیم.

حالا من چندتا سوال سطح بالاتر می‌پرسم، می‌خوام این سوالا رو توی مصاحبه‌های سطح سنیور و مید استفاده کنم :


۱- مگر نه اینکه GIL باعث میشه در لحظه فقط یک thread توی پایتون اجرا بشه؟ پس چرا کتابخونه threading داریم ؟

۲- توی یک برنامه کاملاً پایتونی ( fortran, C, ... درگیر نباشه) بنظر شما کدوم مورد سریعتر هست و چرا ؟

threading یا asynchronous

۳- حالتی به ذهنت می‌رسه که توی یک کد کاملا پایتونی استفاده از threading بهتر از asynchronous باشه ؟


چرا این سوالات ؟ چون خسته شدم انقدر که سخت‌ترین سوال مصاحبه این بود که؛
کی از threading استفاده کنیم کی از multi-process ؟
گفتم چندتا سوال خوب برای مصاحبه طرح کنم، البته دارم روش کار می‌کنم.
۴-۵ تا دیگه اضافه می‌شه



tg-me.com/pyHints/782
Create:
Last Update:

#سوال

اینو حتماً شنیدید:
توی پایتون GIL باعث می‌شه multi-thread واقعی نداشته باشیم.

حالا من چندتا سوال سطح بالاتر می‌پرسم، می‌خوام این سوالا رو توی مصاحبه‌های سطح سنیور و مید استفاده کنم :


۱- مگر نه اینکه GIL باعث میشه در لحظه فقط یک thread توی پایتون اجرا بشه؟ پس چرا کتابخونه threading داریم ؟

۲- توی یک برنامه کاملاً پایتونی ( fortran, C, ... درگیر نباشه) بنظر شما کدوم مورد سریعتر هست و چرا ؟

threading یا asynchronous

۳- حالتی به ذهنت می‌رسه که توی یک کد کاملا پایتونی استفاده از threading بهتر از asynchronous باشه ؟


چرا این سوالات ؟ چون خسته شدم انقدر که سخت‌ترین سوال مصاحبه این بود که؛
کی از threading استفاده کنیم کی از multi-process ؟
گفتم چندتا سوال خوب برای مصاحبه طرح کنم، البته دارم روش کار می‌کنم.
۴-۵ تا دیگه اضافه می‌شه

BY Python Hints


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pyHints/782

View MORE
Open in Telegram


Python Hints Telegram | DID YOU KNOW?

Date: |

Tata Power whose core business is to generate, transmit and distribute electricity has made no money to investors in the last one decade. That is a big blunder considering it is one of the largest power generation companies in the country. One of the reasons is the company's huge debt levels which stood at ₹43,559 crore at the end of March 2021 compared to the company’s market capitalisation of ₹44,447 crore.

For some time, Mr. Durov and a few dozen staffers had no fixed headquarters, but rather traveled the world, setting up shop in one city after another, he told the Journal in 2016. The company now has its operational base in Dubai, though it says it doesn’t keep servers there.Mr. Durov maintains a yearslong friendship from his VK days with actor and tech investor Jared Leto, with whom he shares an ascetic lifestyle that eschews meat and alcohol.

Python Hints from tw


Telegram Python Hints
FROM USA